package com.gitee.controller;

import com.gitee.service.ICommentService;
import com.gitee.vo.CommentVo;
import com.gitee.vo.PageVo;
import com.gitee.vo.ResponseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 评价管理
 */
@RestController
@RequestMapping("/comment")
public class CommentController {

    @Autowired
    private ICommentService commentService;

    /**
     * 评论列表
     * @param keywords
     * @param pageNum
     * @param pageSize
     * @return
     */
    @GetMapping
    public ResponseVo<PageVo<CommentVo>> list(String keywords, Integer pageNum, Integer pageSize) {
        PageVo<CommentVo> commentVoPageVo = commentService.pageCommentVos(keywords, pageNum, pageSize);
        return ResponseVo.ok(commentVoPageVo);
    }

}
